<include file="Layout:header"/>
<div id="content">
    <div class="layout-grid mb clearfix">
        <div class="w220 mr fl">
            <include file="Good:b_cate"/><include file="Good:b_tuijian2"/><!--end cui-box4-->
        </div><!--end w220-->
        <div class="w770 fl">
            <div class="crumbs_nav mb">
                <span class="icon">当前位置：</span>
                <a href="/">首页</a>
                &gt; 
				<a href="{:U('Good/index?cate='.$bigcate['ename'])}" class="blue">{$bigcate['name']}</a>
				<notempty name="subcate">
				&gt; 
				<a href="{:U('Good/index?cate='.$subcate['ename'])}" class="blue">{$subcate['name']}</a>
				</notempty>
                &gt; {$datainfo.name}
            </div>
            <div class="p_info">
                <div class="photo fl mr">
                    {$datainfo['img']|advstr='350px','350px',$srcpre,'alt:'.$datainfo['name']}
                </div>
                <div class="p_info_list fl">
                    <div class="h_title">
                        <a href="#" class="blue dgfs">查看如何订购</a>
                        <h1 class="h_name orange">{$datainfo.name}</h1>
                    </div>
                    <!--end h_title-->
                    <ul>
                        <eq name="datainfo.is_promote" value="1">
                            <li>
                                <strong>特&nbsp;&nbsp;&nbsp;&nbsp;价：</strong>
                                <p class="bbprice-us">
                                    <span>￥</span>{$datainfo.promote_fee|substr=0,-3}
                                </p>
                                (原价：
                                <p class="bbprice-mk">
                                    <span>￥</span>{$datainfo.shop_fee|substr=0,-3}
                                </p>)
                            </li>
                            <else/>
                            <li>
                                <strong>一 口 价：</strong>
                                <p class="bbprice-us">
                                    <span>￥</span>{$datainfo.shop_fee|substr=0,-3}
                                </p>
                            </li>
                        </eq>
                        <li>
                            <strong>最近售出：</strong>
                            <span class="orange">{$datainfo.order_count}</span>件(已有<span class="orange">{$comment_num}</span>人评论) 
                        </li>
                        <li>
                            <strong>运　　费：</strong>
                            <span class="car">快递：10元  EMS：20元</span>
                            <a href="#" class="blue">运费说明</a>
                        </li>
                        <li class="payfs">
                            <strong>付款方式：</strong>
                            <eq name="datainfo.is_cd" value="1">
                                <a href="#" class="orange">货到付款</a>
                                <span class="fgline">|</span>
                            </eq>
                            <a href="#" class="gray6">网银支付</a>
                            <span class="fgline">|</span>
                            <a href="#" class="gray6">支付宝</a>
                            <span class="fgline">|</span>
                            <a href="#" class="gray6">银行汇款/转账</a>
                            <a href="#" class="blue ml">更多&gt;&gt;</a>
                        </li>
                        <li>
                            <strong>在线客服：</strong>
                            <include file="Good:b_show_kefu"/>
                        </li>
                    </ul><!--购买 start-->
                    <include file="Good:b_show_buy"/>
					<include file="Good:b_show_popcart"/>
                    <!--购买 end-->
                </div>
                <div class="clear">
                </div>
                <!--清除浮动-->
            </div>
            <!--详细 end-->
            <include file="Good:b_show_add"/>
        </div>
    </div>
    <include file="Index:b_help"/><!--end index-hlep-->
</div><!--content end-->
<script language="JavaScript">
            $(function(){
                $('.good_attr a').each(function(i){
                    $(this).click(function(){
                        set_attr($(this).attr('id'));
                    });
                });
            });
            
            
            /*
             * ******************************************************
             * 购买商品时选择商品属性
             * ******************************************************
             */
            function set_attr(meid){
                var me = '#' + meid;
                if ($(me).attr('class') == 'p_size_no') {
                    $(me).attr('class', 'p_size');
                    $('input#' + $(me).attr('rel')).val($(me).attr('data'));
                    $(me).html('<span>' + $(me).html() + '</span><i>已选中</i>');
                    $(me).siblings('a.p_size').each(function(i){
                        $(this).html($(this).find('span').html()).attr('class', 'p_size_no');
                    });
                }
            }
            
            /*
             * ******************************************************
             * 显示商品详情
             * ******************************************************
             */
            var good_show = 'detail';
            function goodinfo(id){
                if ($('#good_' + id).length > 0) {
                    if ($('#good_' + id + ':visible').length == 0) {
                        $('#good_' + good_show).hide();
                        $('#goodinfo_tab_' + good_show).removeClass("active");
                        $('#good_' + id).show();
                        good_show = id;
                    }
                }
                else {
                    $('#goodinfo_tab_' + good_show).removeClass("active");
                    if (id == 'comment') {
                        $.ajax({
                            type: "GET",
                            url: "{:U('Good/comment?good_id='.$_GET['good_id'])}",
                            success: function(msg){
                                $('#goodinfo_box').append(msg);
                                $('#good_' + good_show).hide();
                                good_show = id;
                            }
                        });
                    }
                    if (id == 'record') {
                        $.ajax({
                            type: "GET",
                            url: "{:U('Good/record?good_id='.$_GET['good_id'])}",
                            success: function(msg){
                                $('#goodinfo_box').append(msg);
                                $('#good_' + good_show).hide();
                                good_show = id;
                                
                            }
                        });
                    }
                    if (id == 'relas') {
                        $.ajax({
                            type: "GET",
                            url: "{:U('Good/relas?good_id='.$datainfo['good_id'].'&cate_id='.$datainfo['cate_id'])}",
                            success: function(msg){
                                $('#goodinfo_box').append(msg);
                                $('#good_' + good_show).hide();
                                good_show = id;
                            }
                        });
                    }
                    if (id == 'paytype') {
                        $.ajax({
                            type: "GET",
                            url: "{:U('Good/paytype')}",
                            success: function(msg){
                                $('#goodinfo_box').append('<div id="good_paytype" class="gift_detail">' + msg + '</div>');
                                $('#good_' + good_show).hide();
                                good_show = id;
                            }
                        });
                    }
                    if (id == 'buyprogress') {
                        $.ajax({
                            type: "GET",
                            url: "{:U('Good/buyprogress')}",
                            success: function(msg){
                                $('#goodinfo_box').append('<div id="good_buyprogress" class="gift_detail">' + msg + '</div>');
                                $('#good_' + good_show).hide();
                                good_show = id;
                            }
                        });
                    }
                }
                $('#goodinfo_tab_' + id).addClass('active');
                
            }
</script>
<include file="Layout:footer"/>